"""
1. 学习目标

2.

"""
import time

from selenium.webdriver.common.by import By

from common.base import Base


class LoginPage(Base):
    login_url = 'https://ecshop.test2.shopex123.com/user.php'

    def input_username(self, username):
        self.base_find_element((By.NAME, 'username')).send_keys(username)

    def input_password(self, password):
        self.base_find_element((By.NAME, 'password')).send_keys(password)

    def remeber(self):
        self.base_click((By.ID, 'remeber'))

    def login_btn(self):
        self.base_click((By.CLASS_NAME, 'loginbtn'))


if __name__ == '__main__':
    login = LoginPage('chrome')
    login.base_get('https://ecshop.test2.shopex123.com/user.php')
    # 正向的测试用例
    time.sleep(3)
    login.input_username('fine1')
    login.input_password('123456')
    login.remeber()
    login.login_btn()
    time.sleep(3)
